Skip to content

fix(provisioning): convert ECS TaskDefinition volume sub-configurations PascalCase to camelCase - #825

Merged
go-to-k merged 2 commits into
mainfrom
fix/815-ecs-volume-subprops
Jun 13, 2026
Merged

fix(provisioning): convert ECS TaskDefinition volume sub-configurations PascalCase to camelCase#825
go-to-k merged 2 commits into
mainfrom
fix/815-ecs-volume-subprops

Conversation

@go-to-k

@go-to-k go-to-k commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

ECSProvider.convertVolumes had sub-property gaps below the handled Volumes property (the property-coverage gate can't catch these — they're one level down): DockerVolumeConfiguration / FSxWindowsFileServerVolumeConfiguration were dropped entirely, and Host / EFSVolumeConfiguration were cast through WITHOUT PascalCase→camelCase conversion, so their nested keys could reach the SDK in the wrong case (silently dropping the value — the exact class fixed earlier for ContainerDefinitions sub-arrays). Follow-up to #806/#815.

Fix

Added per-type converters following the provider's existing explicit-converter style: convertVolumeHost, convertDockerVolumeConfiguration, convertEFSVolumeConfiguration (+convertEFSAuthorizationConfig), convertFSxWindowsVolumeConfiguration (+auth), and a volumesToCfn SDK→CFn converter for readCurrentStateTaskDefinition. Load-bearing detail verified against the CDK L1 *ToCloudFormation mappings + a real synth: the CFn casings are NOT a uniform first-letter flip — EFS uses FilesystemId (lowercase s) while FSx uses FileSystemId (capital S), and EFS AuthorizationConfig uses IAM (all caps). Stringly-typed Autoprovision (Docker) / TransitEncryptionPort (EFS) are coerced at the wire boundary.

Test plan

  • Unit (tests/unit/provisioning/ecs-provider.test.ts + readback test): assert the exact camelCase RegisterTaskDefinition wire shape for each volume-config type (present→forwarded, absent→undefined) + the PascalCase readback round-trip (no drift false-positive); dedicated string-coercion tests for Autoprovision/TransitEncryptionPort.
  • Real-AWS (ecs-fargate, extended with an efs.FileSystem + AccessPoint + efsVolumeConfiguration task-definition volume): deploy + destroy clean — 23 deleted, 0 errors, 0 orphansverify.sh asserts describe-task-definition shows efs-data's efsVolumeConfiguration reached AWS with camelCase fileSystemId / transitEncryption: ENABLED / authorizationConfig.{accessPointId, iam: ENABLED}.

Scope note

EFS is the integ-verified path. DockerVolumeConfiguration / FSxWindowsFileServerVolumeConfiguration are Windows/Docker-daemon specific and can't run on Fargate — they are thoroughly unit-tested (wire shape asserted), an accepted scope limit noted in the changelog.

Independent review

Code review clean — every converter's output key names verified against the @aws-sdk/client-ecs Volume shape (a wrong key would silently re-drop the value, the bug being fixed); 2 harmless nits (Host:{} → {sourcePath:undefined}; required-field casts trust the template).

Closes #815

go-to-k added 2 commits June 13, 2026 15:26
…ons PascalCase to camelCase

ECSProvider.convertVolumes had sub-property gaps below the handled
Volumes property (one level down, so the property-coverage gate could
not catch them): DockerVolumeConfiguration and
FSxWindowsFileServerVolumeConfiguration were not mapped at all (silently
dropped from RegisterTaskDefinition), and Host / EFSVolumeConfiguration
were cast through raw so their nested PascalCase keys reached the ECS SDK
in the wrong case. This is the same PascalCase-to-camelCase trap already
fixed for the ContainerDefinitions sub-arrays.

convertVolumes now runs each volume sub-block through a dedicated
explicit converter (convertVolumeHost, convertDockerVolumeConfiguration,
convertEFSVolumeConfiguration + convertEFSAuthorizationConfig,
convertFSxWindowsVolumeConfiguration + convertFSxWindowsAuthorizationConfig),
matching the provider's existing per-type converter style. The case
mapping is not a simple first-letter flip in two spots (verified against
the CDK L1 ToCloudFormation mappings): EFS uses FilesystemId (lowercase
s) while FSx uses FileSystemId (capital S), and EFS AuthorizationConfig
uses IAM (all caps), not Iam. Autoprovision and TransitEncryptionPort are
coerced at the wire boundary since CFn can carry them stringly-typed.

readCurrentStateTaskDefinition now normalizes the camelCase SDK volumes
shape back to PascalCase via the new volumesToCfn converter so the drift
snapshot matches the deploy-time template form (forward-looking;
TaskDefinitions are immutable replace-only today).

Tests: 8 new unit tests for the RegisterTaskDefinition wire shape of each
volume config type (present forwarded camelCase, absent omitted) plus a
readCurrentState normalization test; the two pre-existing #806 volume
tests were updated for the new omit-when-absent key set and the corrected
PascalCase Host.SourcePath input. The ecs-fargate integ fixture gains an
EFS FileSystem + AccessPoint and an efsVolumeConfiguration volume on the
task definition; verify.sh asserts describe-task-definition shows the
efsVolumeConfiguration reached AWS with camelCase fields. EFS is the
integ-verified path; DockerVolumeConfiguration / FSx are
Windows/Docker-daemon specific and hard to integ on Fargate, so they are
unit-tested only.

Closes #815
@go-to-k
go-to-k force-pushed the fix/815-ecs-volume-subprops branch from a1c51a5 to 8f625d5 Compare June 13, 2026 06:27
@go-to-k
go-to-k merged commit 2d54d40 into main Jun 13, 2026
5 checks passed
@go-to-k
go-to-k deleted the fix/815-ecs-volume-subprops branch June 13, 2026 06:31
github-actions Bot pushed a commit that referenced this pull request Jun 13, 2026
## [0.220.5](v0.220.4...v0.220.5) (2026-06-13)

### Bug Fixes

* **provisioning:** convert ECS TaskDefinition volume sub-configurations PascalCase to camelCase ([#825](#825)) ([2d54d40](2d54d40))
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.220.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ECS TaskDefinition convertVolumes: map DockerVolumeConfiguration / FSxWindowsFileServerVolumeConfiguration + PascalCase→camelCase for Host/EFS

1 participant